﻿package java_45;

import java.util.Scanner;

public class jisuanqi {
		public static void main(String[] args) {
			try{Scanner input=new Scanner(System.in);
			System.out.println("请输入第一个数");
			int num=input.nextInt();
			System.out.println("请输入第二个数");
			int num2=input.nextInt();
			System.out.println("请输入符号 1.+ 2.- 3.* 4./");
			int fu=input.nextInt();
			switch (fu) {
			case 1:
				System.out.println("和是:" + (num+num2));
				break;
			case 2:
				System.out.println("差是:" + (num-num2));
				break;
			case 3:
				System.out.println("积是:" + (num*num2));
				break;
			case 4:
				System.out.println("商是:" + (num/num2));
				break;
			}
			}catch (Exception ex) {				
				System.err.println("Exception:请输入合法数字和符号");
				System.exit(1);
			}
			finally{
				System.out.println("感谢使用");
			}
		}
}